From 46afb4a9a475898c2a662b8a79e078fbf9bd1b8b Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Sat, 17 Jun 2023 14:40:19 +0200 Subject: [PATCH] GtkFileChooserWidget: Fix condition on visit action Fixes #5899 --- gtk/gtkfilechooserwidget.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index ad3d79ad94..a57be7c0e5 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -1862,6 +1862,7 @@ file_list_update_popover (GtkFileChooserWidget *impl) { GAction *action; gboolean state; + gboolean visit; file_list_build_popover (impl); check_file_list_popover_sensitivity (impl); @@ -1873,6 +1874,9 @@ file_list_update_popover (GtkFileChooserWidget *impl) impl->operation_mode == OPERATION_MODE_BROWSE && impl->browse_files_popover_item != G_MAXUINT; + visit = impl->operation_mode != OPERATION_MODE_BROWSE && + impl->browse_files_popover_item != G_MAXUINT; + action = g_action_map_lookup_action (G_ACTION_MAP (impl->item_actions), "rename"); g_simple_action_set_enabled (G_SIMPLE_ACTION (action), state); @@ -1883,7 +1887,7 @@ file_list_update_popover (GtkFileChooserWidget *impl) g_simple_action_set_enabled (G_SIMPLE_ACTION (action), state); action = g_action_map_lookup_action (G_ACTION_MAP (impl->item_actions), "visit"); - g_simple_action_set_enabled (G_SIMPLE_ACTION (action), (impl->operation_mode != OPERATION_MODE_BROWSE)); + g_simple_action_set_enabled (G_SIMPLE_ACTION (action), visit); action = g_action_map_lookup_action (G_ACTION_MAP (impl->item_actions), "toggle-show-hidden"); g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean (impl->show_hidden)); -- 2.30.2